const ESLintPlugin = require('eslint-webpack-plugin')

module.exports = {
	mode: 'development',
	devtool: 'eval-source-map',
	devServer: {
		port: 3000,
		open: true,
		client: {
			overlay: {
				errors: true,
				warnings: false
			}
		}
	},
	plugins: [
		// 把eslint集成到webpack中
		new ESLintPlugin({
			eslintPath: 'eslint', // 指定什么对代码进行校验
			extensions: ['js', 'jsx', 'ts', 'tsx'],
			exclude: ['node_modules'], // 提升打包速度
			fix: false, // 关闭自动修复
			formatter: 'stylish',
		}),
	],
}
